Drop deprecated gtk_dialog_get_action_area
authorMatthias Clasen <mclasen@redhat.com>
Sun, 20 Nov 2016 02:18:20 +0000 (21:18 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 20 Nov 2016 02:23:17 +0000 (21:23 -0500)
Add an internal version for the few places where we still need it,
and drop it from everywhere else.

gtk/gtkaboutdialog.c
gtk/gtkdialog.c
gtk/gtkdialog.h
gtk/gtkdialogprivate.h
gtk/gtkmessagedialog.c
gtk/gtkmountoperation.c
gtk/gtkrecentchooserdialog.c
testsuite/gtk/builder.c
testsuite/gtk/templates.c

index 8a53711268f5fbe540d01107e7257a0153a725b0..11f33b4369e96567398165513c96e02f7ff7de74 100644 (file)
@@ -686,28 +686,27 @@ apply_use_header_bar (GtkAboutDialog *about)
   g_object_get (about, "use-header-bar", &use_header_bar, NULL);
   if (!use_header_bar)
     {
-      GtkWidget *action_area;
-
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-      action_area = gtk_dialog_get_action_area (GTK_DIALOG (about));
-      G_GNUC_END_IGNORE_DEPRECATIONS
-
       priv->credits_button = gtk_toggle_button_new_with_mnemonic (_("C_redits"));
       g_object_bind_property (priv->credits_page, "visible",
                               priv->credits_button, "visible", G_BINDING_SYNC_CREATE);
       g_signal_connect (priv->credits_button, "toggled", G_CALLBACK (toggle_credits), about);
-      gtk_container_add_with_properties (GTK_CONTAINER (action_area), priv->credits_button,
-                                         "secondary", TRUE,
-                                         NULL);
+
+      gtk_dialog_add_action_widget (GTK_DIALOG (about), priv->credits_button, GTK_RESPONSE_NONE);
+      gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (priv->credits_button)),
+                               priv->credits_button,
+                               "secondary", TRUE,
+                               NULL);
 
       priv->license_button = gtk_toggle_button_new_with_mnemonic (_("_License"));
       g_object_bind_property (priv->license_page, "visible",
                               priv->license_button, "visible", G_BINDING_SYNC_CREATE);
       g_signal_connect (priv->license_button, "toggled", G_CALLBACK (toggle_license), about);
-      gtk_container_add_with_properties (GTK_CONTAINER (action_area), priv->license_button,
-                                         "secondary", TRUE,
-                                         NULL);
 
+      gtk_dialog_add_action_widget (GTK_DIALOG (about), priv->license_button, GTK_RESPONSE_NONE);
+      gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (priv->license_button)),
+                               priv->license_button,
+                               "secondary", TRUE,
+                               NULL);
 
       gtk_dialog_add_button (GTK_DIALOG (about), _("_Close"), GTK_RESPONSE_DELETE_EVENT);
     }
index d8464b34d10a557ddc21353bf2c0aca3dd3c553c..a554cc9e84dbcc1566442c5690b0cf007f8c4f9b 100644 (file)
  * recommended; it allows you to set the dialog title, some convenient
  * flags, and add simple buttons.
  *
- * If “dialog” is a newly created dialog, the two primary areas of the
- * window can be accessed through gtk_dialog_get_content_area() and
- * gtk_dialog_get_action_area(), as can be seen from the example below.
- *
  * A “modal” dialog (that is, one which freezes the rest of the application
  * from user input), can be created by calling gtk_window_set_modal() on the
  * dialog. Use the GTK_WINDOW() macro to cast the widget returned from
@@ -1604,19 +1600,6 @@ gtk_dialog_buildable_add_child (GtkBuildable  *buildable,
     GTK_BUILDER_WARN_INVALID_CHILD_TYPE (buildable, type);
 }
 
-/**
- * gtk_dialog_get_action_area:
- * @dialog: a #GtkDialog
- *
- * Returns the action area of @dialog.
- *
- * Returns: (transfer none): the action area
- *
- * Since: 2.14
- *
- * Deprecated:3.12: Direct access to the action area
- *   is discouraged; use gtk_dialog_add_button(), etc.
- */
 GtkWidget *
 gtk_dialog_get_action_area (GtkDialog *dialog)
 {
index 1538bef7152d96b2af8a544bdbda5a23d55a9ef2..505db6af2a6dce0662a71268401a169c1cfd0431 100644 (file)
@@ -188,8 +188,6 @@ void gtk_dialog_response           (GtkDialog *dialog,
 GDK_AVAILABLE_IN_ALL
 gint gtk_dialog_run                (GtkDialog *dialog);
 
-GDK_DEPRECATED_IN_3_10
-GtkWidget * gtk_dialog_get_action_area  (GtkDialog *dialog);
 GDK_AVAILABLE_IN_ALL
 GtkWidget * gtk_dialog_get_content_area (GtkDialog *dialog);
 GDK_AVAILABLE_IN_3_12
index 626d18835e8f497865bec2582a917e2d3f425890..1c32daa80cce6efce621d4274c67d60333f950ad 100644 (file)
@@ -30,6 +30,7 @@
 G_BEGIN_DECLS
 
 void gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog);
+GtkWidget *gtk_dialog_get_action_area (GtkDialog *dialog);
 
 G_END_DECLS
 
index 39af8f0571beaf6b3ebdb4ffa0a1017b091fa1ef..c90056fd371b875fd01722fa2886e3d53a5c4f5f 100644 (file)
@@ -28,6 +28,7 @@
 #include <string.h>
 
 #include "gtkmessagedialog.h"
+#include "gtkdialogprivate.h"
 #include "gtkaccessible.h"
 #include "gtkbuildable.h"
 #include "gtklabel.h"
@@ -293,9 +294,7 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
   priv->message_type = GTK_MESSAGE_OTHER;
 
   gtk_widget_init_template (GTK_WIDGET (dialog));
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
-G_GNUC_END_IGNORE_DEPRECATIONS
   gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND);
 
   settings = gtk_widget_get_settings (GTK_WIDGET (dialog));
index db8a602181ea4c6f51a5f022d207998ee474770a..d4f55d9478ac7915076f9489691ad9f9b1942728 100644 (file)
@@ -51,6 +51,7 @@
 #include "gtkmain.h"
 #include "gtksettings.h"
 #include "gtkstylecontextprivate.h"
+#include "gtkdialogprivate.h"
 
 #include <glib/gprintf.h>
 
@@ -527,9 +528,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
   priv->dialog = dialog;
 
   content_area = gtk_dialog_get_content_area (dialog);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   action_area = gtk_dialog_get_action_area (dialog);
-G_GNUC_END_IGNORE_DEPRECATIONS
 
   /* Set the dialog up with HIG properties */
   gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
index 9e067f9debcf4606a3a581fb70cead13870b7e66..63c33511e21a23263193b8b2a3c336087f835ad0 100644 (file)
@@ -155,9 +155,7 @@ gtk_recent_chooser_item_activated_cb (GtkRecentChooser *chooser,
   if (gtk_window_activate_default (GTK_WINDOW (dialog)))
     return;
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   action_area = gtk_dialog_get_action_area (rc_dialog);
-G_GNUC_END_IGNORE_DEPRECATIONS
   children = gtk_container_get_children (GTK_CONTAINER (action_area));
   
   for (l = children; l; l = l->next)
index 60fc331f62b7dd0b319b9b9352fd798106e223bc..327bc9bc2f7e2931fe61a3afce0437b9eee6246f 100644 (file)
@@ -876,7 +876,7 @@ static void
 test_children (void)
 {
   GtkBuilder * builder;
-  GtkWidget *content_area, *dialog_action_area;
+  GtkWidget *content_area;
   GList *children;
   const gchar buffer1[] =
     "<interface>"
@@ -939,16 +939,11 @@ test_children (void)
   g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (content_area)), "dialog1-vbox") == 0);
 
   action_area = gtk_builder_get_object (builder, "dialog1-action_area");
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  dialog_action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
-G_GNUC_END_IGNORE_DEPRECATIONS
   g_assert (action_area != NULL);
   g_assert (GTK_IS_BUTTON_BOX (action_area));
   g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (action_area)) == GTK_ORIENTATION_HORIZONTAL);
   g_assert (gtk_widget_get_parent (GTK_WIDGET (action_area)) != NULL);
-  g_assert (dialog_action_area != NULL);
   g_assert (gtk_buildable_get_name (GTK_BUILDABLE (action_area)) != NULL);
-  g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (dialog_action_area)), "dialog1-action_area") == 0);
   gtk_widget_destroy (GTK_WIDGET (dialog));
   g_object_unref (builder);
 }
index 316dc1539d6836ba20306d709328d51da61faac9..a6e201cc4799361a1db708b80b2f7a9e0508ea79 100644 (file)
@@ -37,9 +37,6 @@ test_dialog_basic (void)
 
   dialog = gtk_dialog_new();
   g_assert (GTK_IS_DIALOG (dialog));
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  g_assert (gtk_dialog_get_action_area (GTK_DIALOG (dialog)) != NULL);
-G_GNUC_END_IGNORE_DEPRECATIONS
   g_assert (gtk_dialog_get_content_area (GTK_DIALOG (dialog)) != NULL);
 
   gtk_widget_destroy (dialog);